import request from './request'

/**
 * 手机
 */
export const getPhone = (model) => request.post('/product/getPromoProduct', { categoryName: model.categoryName })

/**
 * 热门家电
 */
export const getHot = (model) => request.post('product/getHotProduct', model)
/** 
 * 全部分类名称
 */
export const getList = (model) => request.post('/product/getCategory', model)

/**
 * 获取全部商品分页
 */
export const getParams = (model) => request.post('product/getAllProduct', model)

/**
 * 点击切换
 */
export const getFilter = (model) => request.post('product/getProductByCategory', model)

/**
 * 进入详情
 */
export const getDetail = (productID) => request.post('product/getDetails', productID)

/**
 * 轮播图
 */
export const Lunbotu = (productID) => request.post('/product/getDetailsPicture', productID)

/**
 * 登录
 */
export const getLogin = (model) => request.post('users/login', model)

/**
 * 注册
 */
export const getRegister = (model) => request.post('users/register', model)

/**
 * 添加收藏
 */
export const getAdd = (model) => request.post('user/collect/addCollect', model)

/**
 * 我的收藏
 */
export const getCollect = (model) => request.post('user/collect/getCollect', model)

/**
 * 删除收藏
 */
export const delCollect = (model) => request.post('user/collect/deleteCollect', model)

/**
 * 加入购物车
 */
export const addCart = (model) => request.post('user/shoppingCart/addShoppingCart', model)

/**
 * 购物车
 */
export const getCart = (model) => request.post('user/shoppingCart/getShoppingCart', model)

/**
 * 删除购物车
 */
export const delCart = (model) => request.post('user/shoppingCart/deleteShoppingCart', model)

/**
 * 获取订单
 */
export const addOrder = (model) => request.post('user/order/addOrder', model)

/**
 * 订单
 */
export const getOrder = (model) => request.post('user/order/getOrder', model)


export const goSearchList = (model) => request.post('product/getProductBySearch', model)
